# Maintainer: Lukas Fleischer <lfleischer@archlinux.org>
# Maintainer: Brett Cornwall <ainola@archlinux.org>
# Contributor: Simon Zimmermann <simon@insmo.com>
# Contributor: Daniel M. Capella <polyzen@archlinux.org>

pkgname=pass
pkgver=1.7.4
pkgrel=3
pkgdesc='Stores, retrieves, generates, and synchronizes passwords securely'
arch=('any')
url='https://www.passwordstore.org/'
license=('GPL2')
depends=('bash' 'gnupg' 'tree')
checkdepends=('git')
makedepends=('git')
optdepends=('git: for Git support'
            'dmenu: for passmenu'
            'xdotool: to type passwords with passmenu'
            'qrencode: for QR code support'
            'vim-plugin-runtime: for redact_pass.vim'
            'xclip: for clipboard support on X11'
            'wl-clipboard: for clipboard support on Wayland')
replaces=('passmenu')
provides=('passmenu')
conflicts=('passmenu')
source=("git+https://git.zx2c4.com/password-store?signed#tag=${pkgver}")
sha256sums=('SKIP')
validpgpkeys=('AB9942E6D4A4CFC3412620A749FC7012A5DE03AE') # Jason A. Donenfeld

check() {
  cd "${srcdir}/password-store"
  make test
}

package() {
  cd "${srcdir}/password-store"
  make DESTDIR="${pkgdir}" WITH_ALLCOMP=yes install

  install -Dm0755 -t "${pkgdir}/usr/bin" contrib/dmenu/passmenu
  install -Dm0644 -t "${pkgdir}/usr/share/vim/vimfiles/plugin" \
    contrib/vim/redact_pass.vim
}
